def regid():
    if len(id) > 8:
        print("ID长度不能超过8位")
    elif set(id).issubset(chars):
        print(id)
    else:
        print("只能由数字、字母、下划线组成")
def regidnum():
    if len(idnum) > 18:
        print("身份证号错误")

chars = set('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_')
id = input("请输入ID（不能超过8位，且只能由数字、字母、下划线组成）:")
email = input("请输入email:")
idnum = input("请输入身份证号:")
regid()
regidnum()
